package com.talent.service.iot.mqtt.model.request;

import com.talent.service.iot.mqtt.model.fix.TlMqttFixedHead;
import com.talent.service.iot.mqtt.model.variable.TlMqttPubCompVariableHead;
import io.netty.handler.codec.mqtt.MqttMessageType;

/**
 * @ClassName：TlMqttPubAckRes
 * @Author: hszhou
 * @Date: 2024/11/26 15:07
 * @Description: 必须描述类做什么事情, 实现什么功能
 */
public class TlMqttPubCompReq {

    private TlMqttFixedHead fixedHead;

    private TlMqttPubCompVariableHead variableHead;

    public TlMqttPubCompReq(TlMqttFixedHead fixedHead, TlMqttPubCompVariableHead variableHead) {
        this.fixedHead = fixedHead;
        this.variableHead = variableHead;
    }

    public TlMqttFixedHead getFixedHead() {
        return fixedHead;
    }

    public void setFixedHead(TlMqttFixedHead fixedHead) {
        this.fixedHead = fixedHead;
    }

    public TlMqttPubCompVariableHead getVariableHead() {
        return variableHead;
    }

    public void setVariableHead(TlMqttPubCompVariableHead variableHead) {
        this.variableHead = variableHead;
    }

        public static TlMqttPubCompReq of(Integer messageId){

        TlMqttFixedHead fixedHead = TlMqttFixedHead.of(MqttMessageType.PUBCOMP);
        TlMqttPubCompVariableHead variableHead  = TlMqttPubCompVariableHead.of(messageId);
        return new TlMqttPubCompReq(fixedHead,variableHead);
    }
}
